home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / tp_wch.com / WATCHMGR.DOC < prev    next >
Encoding:
Text File  |  1989-03-24  |  9.3 KB  |  257 lines

  1.  
  2.                        Watch Manager Version 1.0
  3.  
  4.                 Copyright (c) 1989  Richard W. Prescott
  5.                           All Rights Reserved
  6.  
  7.  
  8.  
  9. Files in this package:
  10.  
  11.      WATCHMGR.DOC - This file
  12.      WATCHMGR.TPU - Watch Manager Version 1.0
  13.      WATCHDEM.PAS - Brief demo of WatchMgr
  14.  
  15.  
  16.  
  17. The following topics are discussed in this file:
  18.  
  19. 0. Overview
  20. 1. Using WatchMgr
  21. 2. Conditional Example
  22. 3. Disclaimer
  23. 4. Source Code Availability
  24. 5. TP&Asm/TP&Asm-M
  25.  
  26.  
  27.  
  28. 0. Overview
  29.  
  30.  
  31. As discussed on page 140 of the Turbo 5.0 User's Guide, there may be
  32. certain expressions that you commonly want to watch or evaluate at
  33. certain points in your program.  This package provides a convenient
  34. alternative to the technique described there.
  35.  
  36. The unit WATCHMGR.TPU consists of three procedures and two functions
  37. which may be used to automatically set and clear watch expressions
  38. under program control as you trace your program in the Integrated
  39. Development Environment.  You are still free to manually set and
  40. clear watches in addition to those being set automatically.  Using
  41. conditional compilation you can easily activate/deactivate the
  42. automatic watch control.
  43.  
  44. Watch Manager Version 1.0 is copyrighted as indicated above.  You
  45. may however share this package and/or upload it to bulletin boards
  46. as long as no fee is charged.  User's groups and PD/shareware
  47. distributors may charge a nominal fee, not to exceed $8, provided
  48. it is accurately represented as payment for their services, not
  49. payment for the software.  In any case, the original unmodified
  50. files must all be present.
  51.  
  52. Please report problems or suggestions to me at the address listed
  53. in section 4, or to my CompUServe mailbox [76656,2476].
  54.  
  55.  
  56.  
  57. 1. Using WatchMgr
  58.  
  59.  
  60. To activate WatchMgr, simply place "WatchMgr" in the Uses clause of
  61. the Main program you are debugging.  You may then use any of the
  62. routines AddWatch, DelWatch, ClrWatch, WatchCount, and WatchStr to
  63. modify the display of watch expressions under program control.
  64.  
  65.  
  66. The interface definitions for the five routines are as follows:
  67.  
  68.        PROCEDURE AddWatch(WatchExpr: STRING);
  69.        PROCEDURE DelWatch(WatchExpr: STRING);
  70.        PROCEDURE ClrWatch;
  71.  
  72.        FUNCTION WatchCount: WORD;
  73.        FUNCTION WatchStr(WatchNo: WORD): STRING;
  74.  
  75.  
  76. AddWatch adds the designated watch expression to the watch window
  77. with leading and trailing (but not intermediate) spaces removed.
  78. The new watch becomes the "current" (highlighted/bulleted) watch.
  79. Like the IDE menu commands, AddWatch permits multiple definitions
  80. of the same watch expression.  If there is a possibility that a
  81. watch may already be defined, call DelWatch before AddWatch to
  82. prevent an additional copy from being generated.  AddWatch is
  83. equivalent to the menu command "Break/Add watch".
  84.  
  85.  
  86. DelWatch searches for the designated watch expression, and, if
  87. found, deletes it from the watch window.  Case differences and
  88. leading/trailing spaces are ignored in searching for a match.
  89. Thus              DelWatch(' GLOBALVAR  ');
  90. will clear the watch set by
  91.                    AddWatch('GlobalVar');
  92. If the deleted watch was the "current" watch, the next older watch
  93. becomes "current".  Otherwise, the "current" watch is unchanged.
  94. If multiple copies of the same watch expression are defined,
  95. DelWatch will delete the oldest copy.  DelWatch is an extension
  96. of the menu command "Break/Delete watch".
  97.  
  98.  
  99. ClrWatch clears all watch expressions from the watch window.  It
  100. is equivalent to the menu command "Break/Remove all watches".
  101.  
  102.  
  103. WatchCount returns the current number of watches defined.  There
  104. is no IDE equivalent.
  105.  
  106.  
  107. WatchStr returns the watch expression corresponding to the parameter
  108. WatchNo (numbered from oldest to most recent).  There is no IDE
  109. equivalent.
  110.  
  111.  
  112. The file WatchDem.Pas gives a brief demonstration of the use of
  113. each of these routines.
  114.  
  115.  
  116.  
  117. 2. Conditional Example
  118.  
  119. The following example shows how to use conditional compilation to
  120. easily activate or deactivate the watch management routines:
  121.  
  122.  
  123.      Program Demo;
  124.      Uses Dos  {$IFDEF Test}  ,WatchMgr  {$ENDIF}  ;
  125.  
  126.      CONST DemoVar: WORD = $15;
  127.  
  128.      BEGIN
  129.        {$IFDEF Test}   ClrWatch; AddWatch ('DemoVar,$');   {$ENDIF}
  130.        DemoVar := DosVersion;
  131.      END.
  132.  
  133.  
  134. To activate the watch routines, set
  135.  
  136.              Options/Compiler/Conditional defines
  137.  
  138. to include "test".  If "test" is not defined, the compiled program
  139. will include no WatchMgr code.
  140.  
  141.  
  142. NOTE: the IDE watch management routines cannot (obviously) be used
  143. in a program which is compiled to disk.  If you should inadvertantly
  144. compile to disk with WatchMgr included, the WatchMgr initialization
  145. code will detect the absence of the IDE and halt with the message:
  146.  
  147.         Watch Manager 1.0 Requires TURBO.EXE 5.0 (IDE)
  148.  
  149.  
  150.  
  151. 3. DISCLAIMER OF WARRANTY
  152.  
  153. This software and accompanying documentation are provided "as is"
  154. and without warranties as to performance or merchantability.
  155.  
  156. This package is provided without any express or implied warranties
  157. whatsoever.  Because of the diversity of conditions and hardware
  158. under which this package may be used, no warranty of fitness for a
  159. particular purpose is offered.  The user is advised to test the
  160. package thoroughly before relying on it.  THE USER MUST ASSUME THE
  161. ENTIRE RISK OF USING THE PACKAGE.
  162.  
  163.  
  164.  
  165. 4. Source Code Availability.
  166.  
  167. For those who are interested in how this package works, the source
  168. code is available from me for the following prices:
  169.  
  170.                   Source Listing .......... $5
  171.  
  172.                   Source Disk (5 1/4) ..... $8
  173.  
  174. The source code consists of a single PAS file containing about 350
  175. lines of assembly code.  It was compiled using the TP&Asm integrated
  176. compile-time assembler (described below) running Turbo Pascal
  177. Version 5.0.
  178.  
  179.    To order, send a check or money order payable to:
  180.  
  181.                      Richard W. Prescott
  182.                      724 Sauk Ridge Trail
  183.                      Madison, WI  53705
  184.  
  185.  
  186.  
  187. 5. TP&Asm/TP&Asm-M
  188.  
  189. TP&Asm is a small assembler which runs Turbo 4.0/5.0 (Integrated
  190. Environment or TPC) as a subprocess and permits you to place
  191. assembly language statements directly into your Pascal source code
  192. in blocks beginning with the keywords "Assemble" and/or "Internal".
  193.  
  194. TP&Asm provides the convenience and flexibility of having "live"
  195. assembly language in your programs which can be modified and
  196. immediately recompiled with no need to exit and reassemble.  You
  197. have complete freedom to place assembly language anywhere in your
  198. program, freely mix Pascal and assembly blocks, freely transfer
  199. between Pascal and assembly blocks via Call/Jump/Loop/Goto to any
  200. Pascal or assembly label, make direct Call, Jmp and Offset
  201. references to Pascal Proc/Functions, and make simplified Pascal
  202. style references to your Pascal and assembly variables and
  203. parameters.  Units compiled with TP&Asm can be distributed and 
  204. Used independent of TP&Asm.  
  205.  
  206. With Turbo Version 5.0, you can trace your assembly code line by
  207. line in the IDE.  Using the record variable CPU defined in the unit 
  208. ASMWATCH (included), you can Watch, Evaluate, and Modify the CPU 
  209. registers and flags during the trace.  
  210.  
  211. The result is an ASSEMBLY Development Environment which is identical 
  212. to your PASCAL Development Environment.  It provides fast assembly 
  213. with no additional disk access, and reports assembly syntax errors 
  214. on the standard Turbo error line with cursor placed on the error.  
  215. It accepts the standard syntax of both MASM and A86, but also 
  216. provides certain enhancements such as the placement of named data 
  217. in the Code Segment.  
  218.  
  219. TP&Asm Version 2.0 will be available from me for $49 plus $3 P&H.
  220. The current Beta Test Version 2 ß is available now for $39 plus $3 
  221. P&H, with a free upgrade to 2.0 when it becomes available.  
  222.  
  223. A shareable Memory Mode version called TP&Asm-M is also available.
  224. The distinction between TP&Asm and TP&Asm-M is that TP&Asm-M is 
  225. intended for developing and debugging assembly language in the IDE, 
  226. but not for final compilation.  You can compile to Memory (with the 
  227. standard Turbo style interactive syntax error detection) and Trace 
  228. your assembly code in the IDE with full capability to Watch, 
  229. Evaluate, and Modify the CPU registers and Flags - then convert to 
  230. INLINE or EXTERNAL after the code is fully developed.  TP&Asm-M's 
  231. INTERNAL statement and its support of the standard syntax of MASM, 
  232. A86, and INLINE.COM simplifies this conversion.  
  233.  
  234. The TP&Asm-M distribution disk can be ordered from me for $5 plus 
  235. $3 P&H, with the $5 being credited toward subsequent registration 
  236. of TP&Asm or TP&Asm-M.  It can also be downloaded from the IBMPRO
  237. or BPROGA forums on CompUServe.  Look for TPA2-A.ARC and TPA2-R.ARC.
  238. Registration for TP&Asm-M is $19.
  239.  
  240.  
  241. To order TP&Asm, please send a check or money order payable to:
  242.  
  243.                       Richard W. Prescott
  244.                       724 Sauk Ridge Trail
  245.                       Madison, WI  53705
  246.  
  247. Please include the following information:
  248.  
  249.    1. Full Version number of the Turbo Pascal compiler you now use.
  250.  
  251.    2. Your registration number for that compiler.
  252.  
  253.    3. If you obtained TP&Asm-M from a bulletin board:
  254.       3a. Area code and phone number of that bulletin board
  255.       3b. Full Version number of the TP&Asm-M version you have
  256.       3c. Directory Date of the README file
  257.